.TH "Connecting, disconnecting from IRC server." 3 "10 Jan 2009" "Version 1.3" "libircclient" \" -*- nroff -*-
.ad l
.nh
.SH NAME
Connecting, disconnecting from IRC server. \- 
.SS "Functions"

.in +1c
.ti -1c
.RI "int \fBirc_connect\fP (\fBirc_session_t\fP *session, const char *server, unsigned short port, const char *server_password, const char *nick, const char *username, const char *realname)"
.br
.RI "\fIInitiates a connection to IRC server. \fP"
.ti -1c
.RI "int \fBirc_connect6\fP (\fBirc_session_t\fP *session, const char *server, unsigned short port, const char *server_password, const char *nick, const char *username, const char *realname)"
.br
.RI "\fIInitiates a connection to IRC server using IPv6. \fP"
.ti -1c
.RI "void \fBirc_disconnect\fP (\fBirc_session_t\fP *session)"
.br
.RI "\fIDisconnects a connection to IRC server. \fP"
.ti -1c
.RI "int \fBirc_is_connected\fP (\fBirc_session_t\fP *session)"
.br
.RI "\fIChecks whether the session is connecting/connected to the IRC server. \fP"
.in -1c
.SH "Function Documentation"
.PP 
.SS "int irc_connect (\fBirc_session_t\fP * session, const char * server, unsigned short port, const char * server_password, const char * nick, const char * username, const char * realname)"
.PP
Initiates a connection to IRC server. 
.PP
\fBParameters:\fP
.RS 4
\fIsession\fP A session to initiate connections on. Must not be NULL. 
.br
\fIserver\fP A domain name or an IP address of the IRC server to connect to. Must not be NULL. 
.br
\fIport\fP An IRC server port, usually 6667. 
.br
\fIserver_password\fP An IRC server password, if the server requires it. May be NULL, in this case password will not be send to the IRC server. Vast majority of IRC servers do not require passwords. 
.br
\fInick\fP A nick, which libircclient will use to login to the IRC server. Must not be NULL. 
.br
\fIusername\fP A username of the account, which is used to connect to the IRC server. This is for information only, will be shown in 'user properties' dialogs and returned by /whois request. May be NULL, in this case 'nobody' will be sent as username. 
.br
\fIrealname\fP A real name of the person, who connects to the IRC. Usually people put some wide-available information here (URL, small description or something else). This information also will be shown in 'user properties' dialogs and returned by /whois request. May be NULL, in this case 'noname' will be sent as username.
.RE
.PP
\fBReturns:\fP
.RS 4
Return code 0 means success. Other value means error, the error code may be obtained through \fBirc_errno()\fP. Any error, generated by the IRC server, is available through \fBirc_callbacks_t::event_numeric\fP.
.RE
.PP
This function prepares and initiates a connection to the IRC server. The connection is done asynchronously (see \fBirc_callbacks_t::event_connect\fP), so the success return value means that connection was initiated (but not completed!) successfully.
.PP
\fBSee also:\fP
.RS 4
\fBirc_run\fP 
.RE
.PP

.SS "int irc_connect6 (\fBirc_session_t\fP * session, const char * server, unsigned short port, const char * server_password, const char * nick, const char * username, const char * realname)"
.PP
Initiates a connection to IRC server using IPv6. 
.PP
\fBParameters:\fP
.RS 4
\fIsession\fP A session to initiate connections on. Must not be NULL. 
.br
\fIserver\fP A domain name or an IP address of the IRC server to connect to. Must not be NULL. 
.br
\fIport\fP An IRC server port, usually 6667. 
.br
\fIserver_password\fP An IRC server password, if the server requires it. May be NULL, in this case password will not be send to the IRC server. Vast majority of IRC servers do not require passwords. 
.br
\fInick\fP A nick, which libircclient will use to login to the IRC server. Must not be NULL. 
.br
\fIusername\fP A username of the account, which is used to connect to the IRC server. This is for information only, will be shown in 'user properties' dialogs and returned by /whois request. May be NULL, in this case 'nobody' will be sent as username. 
.br
\fIrealname\fP A real name of the person, who connects to the IRC. Usually people put some wide-available information here (URL, small description or something else). This information also will be shown in 'user properties' dialogs and returned by /whois request. May be NULL, in this case 'noname' will be sent as username.
.RE
.PP
\fBReturns:\fP
.RS 4
Return code 0 means success. Other value means error, the error code may be obtained through \fBirc_errno()\fP. Any error, generated by the IRC server, is available through \fBirc_callbacks_t::event_numeric\fP.
.RE
.PP
This function prepares and initiates a connection to the IRC server. The connection is done asynchronously (see \fBirc_callbacks_t::event_connect\fP), so the success return value means that connection was initiated (but not completed!) successfully.
.PP
\fBSee also:\fP
.RS 4
\fBirc_run\fP 
.RE
.PP

.SS "void irc_disconnect (\fBirc_session_t\fP * session)"
.PP
Disconnects a connection to IRC server. 
.PP
\fBParameters:\fP
.RS 4
\fIsession\fP An IRC session.
.RE
.PP
\fBReturns:\fP
.RS 4
Return code 0 means success. Other value means error, the error code may be obtained through \fBirc_errno()\fP.
.RE
.PP
This function closes the IRC connection. After that connection is closed, libircclient automatically leaves irc_run loop.
.PP
\fBSee also:\fP
.RS 4
\fBirc_connect\fP \fBirc_run\fP 
.RE
.PP

.SS "int irc_is_connected (\fBirc_session_t\fP * session)"
.PP
Checks whether the session is connecting/connected to the IRC server. 
.PP
\fBParameters:\fP
.RS 4
\fIsession\fP An initialized IRC session.
.RE
.PP
\fBReturns:\fP
.RS 4
Return code 1 means that session is connecting or connected to the IRC server, zero value means that the session has been disconnected.
.RE
.PP
\fBSee also:\fP
.RS 4
\fBirc_connect\fP \fBirc_run\fP 
.RE
.PP

.SH "Author"
.PP 
Generated automatically by Doxygen for libircclient from the source code.
